<!DOCTYPE html>
<html>
<head>
	<title><%= title%></title>
	<script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script>
	<script type="text/javascript" src="../bower_components/bootstrap/dist/js/bootstrap.js"></script>
	<link rel="stylesheet" type="text/css" href="../bower_components/bootstrap/dist/css/bootstrap.css">
	<style type="text/css">
		h2{
			margin-top: 80px;
			margin-bottom: 40px;
			color: #59C7FA;
		}
	</style>
</head>
<body>
<div class="container">
	<div class="col-sm-4 col-sm-offset-4">
		<h2 class="text-center"><%= title%></h2>
		<form action="signup" method="post">
			<div class="form-group">
				<%if(errName!=""){%>
					<div class="alert alert-danger" role="alert">
						<%= errName%>
						<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				<%}%>
				<%if(same!=""){%>
					<div class="alert alert-danger" role="alert">
						<%= same%>
						<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					</div>
				<%}%>				
				<label>用户名：</label>
				<input type="text" class="form-control" name="name" placeholder="User Name">
			</div>
			<%if(errPassword!=""){%>
				<div class="alert alert-danger" role="alert">
					<%= errPassword%>
					<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				</div>
			<%}%>			
			<div class="form-group">
				<label>密码：</label>
				<input type="password" class="form-control" name="password" placeholder="Password">
			</div>
			<div class="checkbox">
				<label>
				<input id="check" type="checkbox" checked="checked">阅读并接受<a href="https://passport.baidu.com/static/passpc-account/html/protocal.html">《用户协议》</a>
				</label>
			</div>
			<button type="submit" class="btn btn-info  btn-block">注册</button>
			<a class="btn btn-block btn-success" href="/users/login">已经注册？</a>
		</form>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
   	$("#check").click(
   		function(){
   			if ($('[type="submit"]').attr("disabled")=="disabled") {
   				$('[type="submit"]').removeAttr("disabled")
   			}else{
   				$('[type="submit"]').attr("disabled","disabled")
   			}
	   	}
   	)
   	setTimeout(function(){
		$('.alert').fadeOut(2000);
	},2000)

/*	$('[name=user]').blur(function(){
		$.post('/users/test',
		{
			name: $('[name=user]').val()
		},
		function(data,status){
			if (data=='用户名已存在') {
				alert(data);
			}
		})
	});*/
</script>